function lmax= distance(n)
k=min(300/(tand(180/n)),sqrt(40000/(2-2*cosd(360/n))));
lmax=k*cosd(180/n)+sqrt(90000-  k^2 *  (sind(180/n))^2     );
end

